<?php
/**
 * Created by PhpStorm.
 * User: Thans
 * Date: 2018/8/12
 * Time: 17:18
 */

namespace app\common\model;

use think\Model;

class LanguageModel extends Model
{
    protected $readonly = ['create_time'];
    public function getList($where = [], $page = '', $limit = '', $order = '', $field = '')
    {
        $that = $this;
        if (!empty($where)) {
            $that = $that->where($where);
        }
        if ($page) {
            $that = $that->page($page);
        }
        if ($limit) {
            $that = $that->limit($limit);
        }
        if ($order) {
            $that = $that->order($order);
        }
        if ($field) {
            $that = $that->field($field);
        }
        return $that->select();
    }
    public function getToal($where = [])
    {
        return $this->where($where)->count();
    }
}
